import { PageEnum } from '@renderer/enums/cacheEnum'
import { router } from '@renderer/router'
// const clMsg = new ClMessage()

export function requestStatusHandler(status: RequestStatus, msg: string) {
  switch (status) {
    case 2:
    case 404:
      router.push(PageEnum.BASE_LOGIN)
      break
    case 403:
      msg = '抱歉，您无权访问此页面。'
      break
    case 500:
      msg = '抱歉，服务器报告错误。'
      break
  }

  // clMsg.error({
  //   message: msg
  // })
}
